package cn.dnui_jpf902.dnuifood_16110100902.controller;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

        import cn.dnui_jpf902.dnuifood_16110100902.R;
        import cn.dnui_jpf902.dnuifood_16110100902.bean.UserBean;
        import cn.dnui_jpf902.dnuifood_16110100902.listener.onRetrofitListener;
        import cn.dnui_jpf902.dnuifood_16110100902.model.UserModel;

public abstract class LoginActivity extends BaseActivity
            implements onRetrofitListener<UserBean>,
        View.OnClickListener{
       private UserModel model;
    private Button btn_login;

        @Override
        protected void onCreate (Bundle savedInstanceState){
        super.onCreate(savedInstanceState);

    }
    @Override
    void initViews() {

        layout_file=R.layout.activity_login;
        setLayout(layout_file);
            btn_login = findViewById(R.id.btn_login);
    }
    @Override
    void initEvents() {
        btn_login.setOnClickListener(this);
    }
    @Override
    void initDatas() {
    }
    @Override
    public void onSuccess(UserBean object,int flag) {
        switch (flag){
           case 1:
                break;
                default:
       }

    }
    @Override
    public void onFalure(String msg) {
    }
    @Override



    public void onClick(View view) {
       model = new UserModel() {
           @Override
           public void register(String username, String userpass, String mobilenum, onRetrofitListener listener) {

           }
       };
       model.login("1","1",this);
    }
}